package pl.edu.agh.ki.ewywiadowka.client.dto;

import java.util.Date;
import java.util.LinkedList;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.google.gwt.user.client.ui.TextBox;

public class StudentDTO implements IsSerializable {

	public Integer numer;
	public String surname;
	public String name;
	public String address;
	public Date birth;
	public String birthPlace;
	
	//klucz obcy
	public ClassDTO clas;
	
	//tabela lacznikowa
	public LinkedList<AttendantDTO> attendants;

	public StudentDTO(String surname, String name, Integer numer, String address,
			Date birth, String birthPlace, LinkedList<AttendantDTO> attendants,
			ClassDTO clas) {
		this.surname = surname;
		this.name = name;
		this.numer = numer;
		this.address = address;
		this.birth = birth;
		this.birthPlace = birthPlace;
		this.attendants = attendants;
		this.clas = clas;
	}

	public StudentDTO() {
	}

	public String toString() {
		return name + " " + surname;
	}
	
	public boolean equals(StudentDTO sdto) {
		return surname.equals(sdto.surname) && name.equals(sdto.name) && numer.equals(sdto.numer) && address.equals(sdto.address) && birth.equals(sdto.birth) && birthPlace.equals(sdto.birthPlace);
	}

}
